﻿using System;
using UnityEngine;

namespace RootMotion.Demos
{
	// Token: 0x020000BF RID: 191
	public class TransferMotion : MonoBehaviour
	{
		// Token: 0x060005DD RID: 1501 RVA: 0x00005C71 File Offset: 0x00003E71
		public void OnEnable()
		{
			this.lastPosition = base.transform.position;
		}

		// Token: 0x060005DE RID: 1502 RVA: 0x000376B0 File Offset: 0x000358B0
		public void Update()
		{
			Vector3 a = base.transform.position - this.lastPosition;
			this.to.position += a * this.transferMotion;
			this.lastPosition = base.transform.position;
		}

		// Token: 0x040004ED RID: 1261
		[Tooltip("The Transform to transfer motion to.")]
		public Transform to;

		// Token: 0x040004EE RID: 1262
		[Range(0f, 1f)]
		[Tooltip("The amount of motion to transfer.")]
		public float transferMotion = 0.9f;

		// Token: 0x040004EF RID: 1263
		public Vector3 lastPosition;
	}
}
